<template>
	<view class="index-page page">
		<view class="content">
			<loading v-if="showLoading"></loading>
			<CustomNav :normal="{ textColor: '#fff', background: '#FF2F34' }" :title="title" :is-back="true">
			</CustomNav>
			<view class="longtext">
				<mp-html :content="content"></mp-html>
			</view>
		</view>
	</view>

</template>

<script>
	import {

		getUserAgreement
	} from '@/api/user.js'
	export default {
		data() {
			return {
				code: '',
				content: '',
				title: ''
			}
		},
		methods: {
			getUserAgreement() {
				getUserAgreement({
					code: this.code
				}).then(res => {
					this.content = res[0].context

				})
			},
		},
		onLoad(e) {
			if (e.code) {
				this.code = e.code
				if (e.code == 'free') {
					this.title = '限时免费'
				} else if (e.code == 'consume') {
					this.title = '消费多少送多少'
				} else {
					this.title = '协议'
				}
			}
			this.getUserAgreement()
		}
	}
</script>


<style lang="scss">
	.index-page {
		overflow: hidden;

		.top-banner {
			width: 100%;
		}

		.content {
			width: 100%;
			overflow-y: auto;
			position: relative;

			.longtext {
				margin-top: 200rpx;
				padding: 30rpx;
			}
		}
	}
</style>